<template>
	<view class="">
		<view class="flex plr-36 pt-20">
			<view @click="getTab(0)">
				<text :class="[isActive==0?'yellow size-26 bold':'']">销量排序</text>
				<u-icon name="arrow-down-fill" size="24" :color="isActive==0?'#F66E23':'#bbb'" class="ml-10"></u-icon>
			</view>
			<view @click="getTab(1)">
				<text :class="[isActive==1?'yellow size-26 bold':'']">价格排序</text>
				<u-icon name="arrow-down-fill" size="24" :color="isActive==1?'#F66E23':'#bbb'" class="ml-10"></u-icon>
			</view>
			<view @click="getTab(2)">
				<text :class="[isActive==2?'yellow size-26 bold':'']">离我最近</text>
				<u-icon name="arrow-down-fill" size="24" :color="isActive==2?'#F66E23':'#bbb'" class="ml-10"></u-icon>
			</view>
		</view>
		<empty v-if="list.length==0" text="暂无商家" top="100"></empty>
		<storeItem v-for="(item,i) in list" :item="item" :key="i" class="plr-15"></storeItem>
	</view>
</template>

<script>
	export default {
		props: ["list"],
		data() {
			return {
				isActive: 0,
			};
		},
		methods: {
			getTab(i) {
				this.isActive = i
				this.$emit('changeTab', this.isActive)
			},
		}
	}
</script>

<style lang="scss" scoped>

</style>
